const BasePlugin = require('./base-plugin');

class WelcomePlugin extends BasePlugin {
    constructor() {
        super();
        this.name = '欢迎插件';
        this.priority = 6; // 高优先级
    }

    onGroupMemberIncrease(event, reply) {
        const welcomeMessages = [
            `👋 欢迎新大佬 @${event.user_id} 加入本群！`,
            `🎉 欢迎 @${event.user_id} ！请先看群规哦~`,
            `🤝 欢迎 @${event.user_id} 加入我们的大家庭！`,
            `🌟 欢迎新朋友 @${event.user_id} ！有什么问题尽管问~`
        ];
        
        const randomMsg = welcomeMessages[Math.floor(Math.random() * welcomeMessages.length)];
        reply(randomMsg);
        
        return true;
    }

    onFriendRequest(event, approve) {
        // 自动同意所有好友申请
        approve(true, '自动通过');
        return true;
    }
}

module.exports = WelcomePlugin;